package org.flown.shop.entity;

import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Base64;


/**
 * 卖家账号与用户账号无关
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class Seller extends BaseEntity
{
    private String nickname;
    @NotNull
    private String account;
    @NotNull
    private String password;


    public Seller(String nickname, String account, String password)
    {
        this.nickname = nickname;
        this.account = account;
        this.password = password;
    }
    

    public String getBase64Account() {return Base64.getEncoder().encodeToString(this.account.getBytes());}
    public String getBase64Password() {return Base64.getEncoder().encodeToString(this.password.getBytes());}

}


